<%@ page import="weeklyreport.User" %>



<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'name', 'error')} required">
	<label for="name">
		<g:message code="user.name.label" default="Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="name" required="" value="${userInstance?.name}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'company', 'error')} required">
	<label for="company">
		<g:message code="user.company.label" default="Company" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="company" required="" value="${userInstance?.company}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'password', 'error')} ">
	<label for="password">
		<g:message code="user.password.label" default="Password" />
		
	</label>
	<g:field type="password" name="password" value="${userInstance?.password}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'role', 'error')} ">
	<label for="role">
		<g:message code="user.role.label" default="Role" />
		
	</label>
	<g:select name="role" from="${userInstance.constraints.role.inList}" value="${userInstance?.role}" valueMessagePrefix="user.role" />
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'issues', 'error')} ">
	<label for="issues">
		<g:message code="user.issues.label" default="Issues" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${userInstance?.issues?}" var="i">
    <li><g:link controller="issue" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="issue" action="create" params="['user.id': userInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'issue.label', default: 'Issue')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'tasks', 'error')} ">
	<label for="tasks">
		<g:message code="user.tasks.label" default="Tasks" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${userInstance?.tasks?}" var="t">
    <li><g:link controller="task" action="show" id="${t.id}">${t?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="task" action="create" params="['user.id': userInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'task.label', default: 'Task')])}</g:link>
</li>
</ul>

</div>

